//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

import Foundation
import SotoCore

extension RedshiftServerless {
    // MARK: Enums

    public enum LogExport: String, CustomStringConvertible, Codable, _SotoSendable {
        case connectionlog
        case useractivitylog
        case userlog
        public var description: String { return self.rawValue }
    }

    public enum NamespaceStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case available = "AVAILABLE"
        case deleting = "DELETING"
        case modifying = "MODIFYING"
        public var description: String { return self.rawValue }
    }

    public enum SnapshotStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case available = "AVAILABLE"
        case cancelled = "CANCELLED"
        case copying = "COPYING"
        case creating = "CREATING"
        case deleted = "DELETED"
        case failed = "FAILED"
        public var description: String { return self.rawValue }
    }

    public enum UsageLimitBreachAction: String, CustomStringConvertible, Codable, _SotoSendable {
        case deactivate
        case emitMetric = "emit-metric"
        case log
        public var description: String { return self.rawValue }
    }

    public enum UsageLimitPeriod: String, CustomStringConvertible, Codable, _SotoSendable {
        case daily
        case monthly
        case weekly
        public var description: String { return self.rawValue }
    }

    public enum UsageLimitUsageType: String, CustomStringConvertible, Codable, _SotoSendable {
        case crossRegionDatasharing = "cross-region-datasharing"
        case serverlessCompute = "serverless-compute"
        public var description: String { return self.rawValue }
    }

    public enum WorkgroupStatus: String, CustomStringConvertible, Codable, _SotoSendable {
        case available = "AVAILABLE"
        case creating = "CREATING"
        case deleting = "DELETING"
        case modifying = "MODIFYING"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct ConfigParameter: AWSEncodableShape & AWSDecodableShape {
        /// The key of the parameter. The options are datestyle, enable_user_activity_logging, query_group, search_path, and max_query_execution_time.
        public let parameterKey: String?
        /// The value of the parameter to set.
        public let parameterValue: String?

        public init(parameterKey: String? = nil, parameterValue: String? = nil) {
            self.parameterKey = parameterKey
            self.parameterValue = parameterValue
        }

        private enum CodingKeys: String, CodingKey {
            case parameterKey
            case parameterValue
        }
    }

    public struct ConvertRecoveryPointToSnapshotRequest: AWSEncodableShape {
        /// The unique identifier of the recovery point.
        public let recoveryPointId: String
        /// How long to retain the snapshot.
        public let retentionPeriod: Int?
        /// The name of the snapshot.
        public let snapshotName: String
        /// An array of Tag objects  to associate with the created snapshot.
        public let tags: [Tag]?

        public init(recoveryPointId: String, retentionPeriod: Int? = nil, snapshotName: String, tags: [Tag]? = nil) {
            self.recoveryPointId = recoveryPointId
            self.retentionPeriod = retentionPeriod
            self.snapshotName = snapshotName
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case recoveryPointId
            case retentionPeriod
            case snapshotName
            case tags
        }
    }

    public struct ConvertRecoveryPointToSnapshotResponse: AWSDecodableShape {
        /// The snapshot converted from the recovery point.
        public let snapshot: Snapshot?

        public init(snapshot: Snapshot? = nil) {
            self.snapshot = snapshot
        }

        private enum CodingKeys: String, CodingKey {
            case snapshot
        }
    }

    public struct CreateEndpointAccessRequest: AWSEncodableShape {
        /// The name of the VPC endpoint. An endpoint name must contain 1-30 characters.  Valid characters are A-Z, a-z, 0-9, and hyphen(-). The first character must be a letter.  The name can't contain two consecutive hyphens or end with a hyphen.
        public let endpointName: String
        /// The unique identifers of subnets from which  Amazon Redshift Serverless chooses one to deploy a VPC endpoint.
        public let subnetIds: [String]
        /// The unique identifiers of the security group that defines the ports,  protocols, and sources for inbound traffic that you are authorizing into your endpoint.
        public let vpcSecurityGroupIds: [String]?
        /// The name of the workgroup to associate with the VPC endpoint.
        public let workgroupName: String

        public init(endpointName: String, subnetIds: [String], vpcSecurityGroupIds: [String]? = nil, workgroupName: String) {
            self.endpointName = endpointName
            self.subnetIds = subnetIds
            self.vpcSecurityGroupIds = vpcSecurityGroupIds
            self.workgroupName = workgroupName
        }

        private enum CodingKeys: String, CodingKey {
            case endpointName
            case subnetIds
            case vpcSecurityGroupIds
            case workgroupName
        }
    }

    public struct CreateEndpointAccessResponse: AWSDecodableShape {
        /// The created VPC endpoint.
        public let endpoint: EndpointAccess?

        public init(endpoint: EndpointAccess? = nil) {
            self.endpoint = endpoint
        }

        private enum CodingKeys: String, CodingKey {
            case endpoint
        }
    }

    public struct CreateNamespaceRequest: AWSEncodableShape {
        /// The username of the administrator for the first database created in the namespace.
        public let adminUsername: String?
        /// The password of the administrator for the first database created in the namespace.
        public let adminUserPassword: String?
        /// The name of the first database created in the namespace.
        public let dbName: String?
        /// The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.
        public let defaultIamRoleArn: String?
        /// A list of IAM roles to associate with the namespace.
        public let iamRoles: [String]?
        /// The ID of the Amazon Web Services Key Management Service key used to encrypt your data.
        public let kmsKeyId: String?
        /// The types of logs the namespace can export.  Available export types are userlog, connectionlog, and useractivitylog.
        public let logExports: [LogExport]?
        /// The name of the namespace.
        public let namespaceName: String
        /// A list of tag instances.
        public let tags: [Tag]?

        public init(adminUsername: String? = nil, adminUserPassword: String? = nil, dbName: String? = nil, defaultIamRoleArn: String? = nil, iamRoles: [String]? = nil, kmsKeyId: String? = nil, logExports: [LogExport]? = nil, namespaceName: String, tags: [Tag]? = nil) {
            self.adminUsername = adminUsername
            self.adminUserPassword = adminUserPassword
            self.dbName = dbName
            self.defaultIamRoleArn = defaultIamRoleArn
            self.iamRoles = iamRoles
            self.kmsKeyId = kmsKeyId
            self.logExports = logExports
            self.namespaceName = namespaceName
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.logExports, name: "logExports", parent: name, max: 16)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, max: 64)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, min: 3)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, pattern: "^[a-z0-9-]+$")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case adminUsername
            case adminUserPassword
            case dbName
            case defaultIamRoleArn
            case iamRoles
            case kmsKeyId
            case logExports
            case namespaceName
            case tags
        }
    }

    public struct CreateNamespaceResponse: AWSDecodableShape {
        /// The created namespace object.
        public let namespace: Namespace?

        public init(namespace: Namespace? = nil) {
            self.namespace = namespace
        }

        private enum CodingKeys: String, CodingKey {
            case namespace
        }
    }

    public struct CreateSnapshotRequest: AWSEncodableShape {
        /// The namespace to create a snapshot for.
        public let namespaceName: String
        /// How long to retain the created snapshot.
        public let retentionPeriod: Int?
        /// The name of the snapshot.
        public let snapshotName: String
        /// An array of Tag objects to associate with the snapshot.
        public let tags: [Tag]?

        public init(namespaceName: String, retentionPeriod: Int? = nil, snapshotName: String, tags: [Tag]? = nil) {
            self.namespaceName = namespaceName
            self.retentionPeriod = retentionPeriod
            self.snapshotName = snapshotName
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case namespaceName
            case retentionPeriod
            case snapshotName
            case tags
        }
    }

    public struct CreateSnapshotResponse: AWSDecodableShape {
        /// The created snapshot object.
        public let snapshot: Snapshot?

        public init(snapshot: Snapshot? = nil) {
            self.snapshot = snapshot
        }

        private enum CodingKeys: String, CodingKey {
            case snapshot
        }
    }

    public struct CreateUsageLimitRequest: AWSEncodableShape {
        /// The limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. The value must be a positive number.
        public let amount: Int64
        /// The action that Amazon Redshift Serverless takes when the limit is reached. The default is log.
        public let breachAction: UsageLimitBreachAction?
        /// The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.
        public let period: UsageLimitPeriod?
        /// The Amazon Resource Name (ARN) of the Amazon Redshift Serverless resource to create the usage limit for.
        public let resourceArn: String
        /// The type of Amazon Redshift Serverless usage to create a usage limit for.
        public let usageType: UsageLimitUsageType

        public init(amount: Int64, breachAction: UsageLimitBreachAction? = nil, period: UsageLimitPeriod? = nil, resourceArn: String, usageType: UsageLimitUsageType) {
            self.amount = amount
            self.breachAction = breachAction
            self.period = period
            self.resourceArn = resourceArn
            self.usageType = usageType
        }

        private enum CodingKeys: String, CodingKey {
            case amount
            case breachAction
            case period
            case resourceArn
            case usageType
        }
    }

    public struct CreateUsageLimitResponse: AWSDecodableShape {
        /// The returned usage limit object.
        public let usageLimit: UsageLimit?

        public init(usageLimit: UsageLimit? = nil) {
            self.usageLimit = usageLimit
        }

        private enum CodingKeys: String, CodingKey {
            case usageLimit
        }
    }

    public struct CreateWorkgroupRequest: AWSEncodableShape {
        /// The base data warehouse capacity of the workgroup in Redshift Processing Units (RPUs).
        public let baseCapacity: Int?
        /// An array of parameters to set for more control over a serverless database. The options are datestyle, enable_user_activity_logging, query_group, search_path, and max_query_execution_time.
        public let configParameters: [ConfigParameter]?
        /// The value that specifies whether to turn on enhanced virtual  private cloud (VPC) routing, which forces Amazon Redshift Serverless to route traffic through your VPC instead of over the internet.
        public let enhancedVpcRouting: Bool?
        /// The name of the namespace to associate with the workgroup.
        public let namespaceName: String
        /// The custom port to use when connecting to a workgroup. Valid port ranges are 5431-5455 and 8191-8215. The default is 5439.
        public let port: Int?
        /// A value that specifies whether the workgroup can be accessed from a public network.
        public let publiclyAccessible: Bool?
        /// An array of security group IDs to associate with the workgroup.
        public let securityGroupIds: [String]?
        /// An array of VPC subnet IDs to associate with the workgroup.
        public let subnetIds: [String]?
        /// A array of tag instances.
        public let tags: [Tag]?
        /// The name of the created workgroup.
        public let workgroupName: String

        public init(baseCapacity: Int? = nil, configParameters: [ConfigParameter]? = nil, enhancedVpcRouting: Bool? = nil, namespaceName: String, port: Int? = nil, publiclyAccessible: Bool? = nil, securityGroupIds: [String]? = nil, subnetIds: [String]? = nil, tags: [Tag]? = nil, workgroupName: String) {
            self.baseCapacity = baseCapacity
            self.configParameters = configParameters
            self.enhancedVpcRouting = enhancedVpcRouting
            self.namespaceName = namespaceName
            self.port = port
            self.publiclyAccessible = publiclyAccessible
            self.securityGroupIds = securityGroupIds
            self.subnetIds = subnetIds
            self.tags = tags
            self.workgroupName = workgroupName
        }

        public func validate(name: String) throws {
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, max: 64)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, min: 3)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, pattern: "^[a-z0-9-]+$")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, max: 64)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, min: 3)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, pattern: "^[a-z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case baseCapacity
            case configParameters
            case enhancedVpcRouting
            case namespaceName
            case port
            case publiclyAccessible
            case securityGroupIds
            case subnetIds
            case tags
            case workgroupName
        }
    }

    public struct CreateWorkgroupResponse: AWSDecodableShape {
        /// The created workgroup object.
        public let workgroup: Workgroup?

        public init(workgroup: Workgroup? = nil) {
            self.workgroup = workgroup
        }

        private enum CodingKeys: String, CodingKey {
            case workgroup
        }
    }

    public struct DeleteEndpointAccessRequest: AWSEncodableShape {
        /// The name of the VPC endpoint to delete.
        public let endpointName: String

        public init(endpointName: String) {
            self.endpointName = endpointName
        }

        private enum CodingKeys: String, CodingKey {
            case endpointName
        }
    }

    public struct DeleteEndpointAccessResponse: AWSDecodableShape {
        /// The deleted VPC endpoint.
        public let endpoint: EndpointAccess?

        public init(endpoint: EndpointAccess? = nil) {
            self.endpoint = endpoint
        }

        private enum CodingKeys: String, CodingKey {
            case endpoint
        }
    }

    public struct DeleteNamespaceRequest: AWSEncodableShape {
        /// The name of the snapshot to be created before the namespace is deleted.
        public let finalSnapshotName: String?
        /// How long to retain the final snapshot.
        public let finalSnapshotRetentionPeriod: Int?
        /// The name of the namespace to delete.
        public let namespaceName: String

        public init(finalSnapshotName: String? = nil, finalSnapshotRetentionPeriod: Int? = nil, namespaceName: String) {
            self.finalSnapshotName = finalSnapshotName
            self.finalSnapshotRetentionPeriod = finalSnapshotRetentionPeriod
            self.namespaceName = namespaceName
        }

        public func validate(name: String) throws {
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, max: 64)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, min: 3)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, pattern: "^[a-z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case finalSnapshotName
            case finalSnapshotRetentionPeriod
            case namespaceName
        }
    }

    public struct DeleteNamespaceResponse: AWSDecodableShape {
        /// The deleted namespace object.
        public let namespace: Namespace

        public init(namespace: Namespace) {
            self.namespace = namespace
        }

        private enum CodingKeys: String, CodingKey {
            case namespace
        }
    }

    public struct DeleteResourcePolicyRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the policy to delete.
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn
        }
    }

    public struct DeleteResourcePolicyResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteSnapshotRequest: AWSEncodableShape {
        /// The name of the snapshot to be deleted.
        public let snapshotName: String

        public init(snapshotName: String) {
            self.snapshotName = snapshotName
        }

        private enum CodingKeys: String, CodingKey {
            case snapshotName
        }
    }

    public struct DeleteSnapshotResponse: AWSDecodableShape {
        /// The deleted snapshot object.
        public let snapshot: Snapshot?

        public init(snapshot: Snapshot? = nil) {
            self.snapshot = snapshot
        }

        private enum CodingKeys: String, CodingKey {
            case snapshot
        }
    }

    public struct DeleteUsageLimitRequest: AWSEncodableShape {
        /// The unique identifier of the usage limit to delete.
        public let usageLimitId: String

        public init(usageLimitId: String) {
            self.usageLimitId = usageLimitId
        }

        private enum CodingKeys: String, CodingKey {
            case usageLimitId
        }
    }

    public struct DeleteUsageLimitResponse: AWSDecodableShape {
        /// The deleted usage limit object.
        public let usageLimit: UsageLimit?

        public init(usageLimit: UsageLimit? = nil) {
            self.usageLimit = usageLimit
        }

        private enum CodingKeys: String, CodingKey {
            case usageLimit
        }
    }

    public struct DeleteWorkgroupRequest: AWSEncodableShape {
        /// The name of the workgroup to be deleted.
        public let workgroupName: String

        public init(workgroupName: String) {
            self.workgroupName = workgroupName
        }

        public func validate(name: String) throws {
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, max: 64)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, min: 3)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, pattern: "^[a-z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case workgroupName
        }
    }

    public struct DeleteWorkgroupResponse: AWSDecodableShape {
        /// The deleted workgroup object.
        public let workgroup: Workgroup

        public init(workgroup: Workgroup) {
            self.workgroup = workgroup
        }

        private enum CodingKeys: String, CodingKey {
            case workgroup
        }
    }

    public struct Endpoint: AWSDecodableShape {
        /// The DNS address of the VPC endpoint.
        public let address: String?
        /// The port that Amazon Redshift Serverless listens on.
        public let port: Int?
        /// An array of VpcEndpoint objects.
        public let vpcEndpoints: [VpcEndpoint]?

        public init(address: String? = nil, port: Int? = nil, vpcEndpoints: [VpcEndpoint]? = nil) {
            self.address = address
            self.port = port
            self.vpcEndpoints = vpcEndpoints
        }

        private enum CodingKeys: String, CodingKey {
            case address
            case port
            case vpcEndpoints
        }
    }

    public struct EndpointAccess: AWSDecodableShape {
        /// The DNS address of the endpoint.
        public let address: String?
        /// The Amazon Resource Name (ARN) of the VPC endpoint.
        public let endpointArn: String?
        /// The time that the endpoint was created.
        public let endpointCreateTime: Date?
        /// The name of the VPC endpoint.
        public let endpointName: String?
        /// The status of the VPC endpoint.
        public let endpointStatus: String?
        /// The port number on which Amazon Redshift Serverless accepts incoming connections.
        public let port: Int?
        /// The unique identifier of subnets  where Amazon Redshift Serverless choose to deploy the VPC endpoint.
        public let subnetIds: [String]?
        /// The connection endpoint for connecting to Amazon Redshift Serverless.
        public let vpcEndpoint: VpcEndpoint?
        /// The security groups associated with the endpoint.
        public let vpcSecurityGroups: [VpcSecurityGroupMembership]?
        /// The name of the workgroup associated with the endpoint.
        public let workgroupName: String?

        public init(address: String? = nil, endpointArn: String? = nil, endpointCreateTime: Date? = nil, endpointName: String? = nil, endpointStatus: String? = nil, port: Int? = nil, subnetIds: [String]? = nil, vpcEndpoint: VpcEndpoint? = nil, vpcSecurityGroups: [VpcSecurityGroupMembership]? = nil, workgroupName: String? = nil) {
            self.address = address
            self.endpointArn = endpointArn
            self.endpointCreateTime = endpointCreateTime
            self.endpointName = endpointName
            self.endpointStatus = endpointStatus
            self.port = port
            self.subnetIds = subnetIds
            self.vpcEndpoint = vpcEndpoint
            self.vpcSecurityGroups = vpcSecurityGroups
            self.workgroupName = workgroupName
        }

        private enum CodingKeys: String, CodingKey {
            case address
            case endpointArn
            case endpointCreateTime
            case endpointName
            case endpointStatus
            case port
            case subnetIds
            case vpcEndpoint
            case vpcSecurityGroups
            case workgroupName
        }
    }

    public struct GetCredentialsRequest: AWSEncodableShape {
        /// The name of the database to get temporary authorization to log on to. Constraints:   Must be 1 to 64 alphanumeric characters or hyphens.   Must contain only uppercase or lowercase letters, numbers, underscore, plus sign, period (dot), at symbol (@), or hyphen.   The first character must be a letter.   Must not contain a colon ( : ) or slash ( / ).   Cannot be a reserved word. A list of reserved words can be found  in Reserved Words   in the Amazon Redshift Database Developer Guide
        public let dbName: String?
        /// The number of seconds until the returned temporary password expires. The minimum is 900 seconds, and the maximum is 3600 seconds.
        public let durationSeconds: Int?
        /// The name of the workgroup associated with the database.
        public let workgroupName: String

        public init(dbName: String? = nil, durationSeconds: Int? = nil, workgroupName: String) {
            self.dbName = dbName
            self.durationSeconds = durationSeconds
            self.workgroupName = workgroupName
        }

        public func validate(name: String) throws {
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, max: 64)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, min: 3)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, pattern: "^[a-z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case dbName
            case durationSeconds
            case workgroupName
        }
    }

    public struct GetCredentialsResponse: AWSDecodableShape {
        /// A temporary password that authorizes the user name returned by  DbUser to log on to the database DbName.
        public let dbPassword: String?
        /// A database user name that is authorized to log on to the database DbName using the password DbPassword. If the specified DbUser exists in the database,  the new user name has the same database privileges as the the user named in  DbUser. By default, the user is added to PUBLIC.
        public let dbUser: String?
        /// The date and time the password in DbPassword expires.
        public let expiration: Date?
        /// The date and time of when the DbUser and DbPassword  authorization refreshes.
        public let nextRefreshTime: Date?

        public init(dbPassword: String? = nil, dbUser: String? = nil, expiration: Date? = nil, nextRefreshTime: Date? = nil) {
            self.dbPassword = dbPassword
            self.dbUser = dbUser
            self.expiration = expiration
            self.nextRefreshTime = nextRefreshTime
        }

        private enum CodingKeys: String, CodingKey {
            case dbPassword
            case dbUser
            case expiration
            case nextRefreshTime
        }
    }

    public struct GetEndpointAccessRequest: AWSEncodableShape {
        /// The name of the VPC endpoint to return information for.
        public let endpointName: String

        public init(endpointName: String) {
            self.endpointName = endpointName
        }

        private enum CodingKeys: String, CodingKey {
            case endpointName
        }
    }

    public struct GetEndpointAccessResponse: AWSDecodableShape {
        /// The returned VPC endpoint.
        public let endpoint: EndpointAccess?

        public init(endpoint: EndpointAccess? = nil) {
            self.endpoint = endpoint
        }

        private enum CodingKeys: String, CodingKey {
            case endpoint
        }
    }

    public struct GetNamespaceRequest: AWSEncodableShape {
        /// The name of the namespace to retrieve information for.
        public let namespaceName: String

        public init(namespaceName: String) {
            self.namespaceName = namespaceName
        }

        public func validate(name: String) throws {
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, max: 64)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, min: 3)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, pattern: "^[a-z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case namespaceName
        }
    }

    public struct GetNamespaceResponse: AWSDecodableShape {
        /// The returned namespace object.
        public let namespace: Namespace

        public init(namespace: Namespace) {
            self.namespace = namespace
        }

        private enum CodingKeys: String, CodingKey {
            case namespace
        }
    }

    public struct GetRecoveryPointRequest: AWSEncodableShape {
        /// The unique identifier of the recovery point to return information for.
        public let recoveryPointId: String

        public init(recoveryPointId: String) {
            self.recoveryPointId = recoveryPointId
        }

        private enum CodingKeys: String, CodingKey {
            case recoveryPointId
        }
    }

    public struct GetRecoveryPointResponse: AWSDecodableShape {
        /// The returned recovery point object.
        public let recoveryPoint: RecoveryPoint?

        public init(recoveryPoint: RecoveryPoint? = nil) {
            self.recoveryPoint = recoveryPoint
        }

        private enum CodingKeys: String, CodingKey {
            case recoveryPoint
        }
    }

    public struct GetResourcePolicyRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource to return.
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn
        }
    }

    public struct GetResourcePolicyResponse: AWSDecodableShape {
        /// The returned resource policy.
        public let resourcePolicy: ResourcePolicy?

        public init(resourcePolicy: ResourcePolicy? = nil) {
            self.resourcePolicy = resourcePolicy
        }

        private enum CodingKeys: String, CodingKey {
            case resourcePolicy
        }
    }

    public struct GetSnapshotRequest: AWSEncodableShape {
        /// The owner Amazon Web Services account of a snapshot shared with another user.
        public let ownerAccount: String?
        /// The Amazon Resource Name (ARN) of the snapshot to return.
        public let snapshotArn: String?
        /// The name of the snapshot to return.
        public let snapshotName: String?

        public init(ownerAccount: String? = nil, snapshotArn: String? = nil, snapshotName: String? = nil) {
            self.ownerAccount = ownerAccount
            self.snapshotArn = snapshotArn
            self.snapshotName = snapshotName
        }

        private enum CodingKeys: String, CodingKey {
            case ownerAccount
            case snapshotArn
            case snapshotName
        }
    }

    public struct GetSnapshotResponse: AWSDecodableShape {
        /// The returned snapshot object.
        public let snapshot: Snapshot?

        public init(snapshot: Snapshot? = nil) {
            self.snapshot = snapshot
        }

        private enum CodingKeys: String, CodingKey {
            case snapshot
        }
    }

    public struct GetTableRestoreStatusRequest: AWSEncodableShape {
        /// The ID of the RestoreTableFromSnapshot request to return status for.
        public let tableRestoreRequestId: String

        public init(tableRestoreRequestId: String) {
            self.tableRestoreRequestId = tableRestoreRequestId
        }

        private enum CodingKeys: String, CodingKey {
            case tableRestoreRequestId
        }
    }

    public struct GetTableRestoreStatusResponse: AWSDecodableShape {
        /// The returned TableRestoreStatus object that contains information about the status of your RestoreTableFromSnapshot request.
        public let tableRestoreStatus: TableRestoreStatus?

        public init(tableRestoreStatus: TableRestoreStatus? = nil) {
            self.tableRestoreStatus = tableRestoreStatus
        }

        private enum CodingKeys: String, CodingKey {
            case tableRestoreStatus
        }
    }

    public struct GetUsageLimitRequest: AWSEncodableShape {
        /// The unique identifier of the usage limit to return information for.
        public let usageLimitId: String

        public init(usageLimitId: String) {
            self.usageLimitId = usageLimitId
        }

        private enum CodingKeys: String, CodingKey {
            case usageLimitId
        }
    }

    public struct GetUsageLimitResponse: AWSDecodableShape {
        /// The returned usage limit object.
        public let usageLimit: UsageLimit?

        public init(usageLimit: UsageLimit? = nil) {
            self.usageLimit = usageLimit
        }

        private enum CodingKeys: String, CodingKey {
            case usageLimit
        }
    }

    public struct GetWorkgroupRequest: AWSEncodableShape {
        /// The name of the workgroup to return information for.
        public let workgroupName: String

        public init(workgroupName: String) {
            self.workgroupName = workgroupName
        }

        public func validate(name: String) throws {
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, max: 64)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, min: 3)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, pattern: "^[a-z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case workgroupName
        }
    }

    public struct GetWorkgroupResponse: AWSDecodableShape {
        /// The returned workgroup object.
        public let workgroup: Workgroup

        public init(workgroup: Workgroup) {
            self.workgroup = workgroup
        }

        private enum CodingKeys: String, CodingKey {
            case workgroup
        }
    }

    public struct ListEndpointAccessRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// An optional parameter that specifies the maximum number of results to return. You can use nextToken to display the next page of results.
        public let maxResults: Int?
        /// If your initial ListEndpointAccess operation returns a nextToken, you can include the returned nextToken in following ListEndpointAccess operations, which returns results in the next page.
        public let nextToken: String?
        /// The unique identifier of the virtual private cloud with access to Amazon Redshift Serverless.
        public let vpcId: String?
        /// The name of the workgroup associated with the VPC endpoint to return.
        public let workgroupName: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil, vpcId: String? = nil, workgroupName: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.vpcId = vpcId
            self.workgroupName = workgroupName
        }

        private enum CodingKeys: String, CodingKey {
            case vpcId
            case workgroupName
        }
    }

    public struct ListEndpointAccessResponse: AWSDecodableShape {
        /// The returned VPC endpoints.
        public let endpoints: [EndpointAccess]
        /// When nextToken is returned, there are more results available.  The value of nextToken is a unique pagination token for each page.  Make the call again using the returned token to retrieve the next page.
        public let nextToken: String?

        public init(endpoints: [EndpointAccess], nextToken: String? = nil) {
            self.endpoints = endpoints
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case endpoints
            case nextToken
        }
    }

    public struct ListNamespacesRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// An optional parameter that specifies the maximum number of results to return. You can use nextToken to display the next page of results.
        public let maxResults: Int?
        /// If your initial ListNamespaces operation returns a nextToken, you can include the returned nextToken in following ListNamespaces operations, which returns results in the next page.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListNamespacesResponse: AWSDecodableShape {
        /// The list of returned namespaces.
        public let namespaces: [Namespace]
        /// When nextToken is returned, there are more results available.  The value of nextToken is a unique pagination token for each page.  Make the call again using the returned token to retrieve the next page.
        public let nextToken: String?

        public init(namespaces: [Namespace], nextToken: String? = nil) {
            self.namespaces = namespaces
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case namespaces
            case nextToken
        }
    }

    public struct ListRecoveryPointsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// The time when creation of the recovery point finished.
        public let endTime: Date?
        /// An optional parameter that specifies the maximum number of results to return. You can use nextToken to display the next page of results.
        public let maxResults: Int?
        /// The Amazon Resource Name (ARN) of the namespace from which to list recovery points.
        public let namespaceArn: String?
        /// The name of the namespace to list recovery points for.
        public let namespaceName: String?
        /// If your initial ListRecoveryPoints operation returns a nextToken, you can include the returned nextToken in following ListRecoveryPoints operations, which returns results in the next page.
        public let nextToken: String?
        /// The time when the recovery point's creation was initiated.
        public let startTime: Date?

        public init(endTime: Date? = nil, maxResults: Int? = nil, namespaceArn: String? = nil, namespaceName: String? = nil, nextToken: String? = nil, startTime: Date? = nil) {
            self.endTime = endTime
            self.maxResults = maxResults
            self.namespaceArn = namespaceArn
            self.namespaceName = namespaceName
            self.nextToken = nextToken
            self.startTime = startTime
        }

        public func validate(name: String) throws {
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, max: 64)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, min: 3)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, pattern: "^[a-z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case endTime
            case namespaceArn
            case namespaceName
            case startTime
        }
    }

    public struct ListRecoveryPointsResponse: AWSDecodableShape {
        /// If nextToken is returned, there are more results available.  The value of nextToken is a unique pagination token for each page.  Make the call again using the returned token to retrieve the next page.
        public let nextToken: String?
        /// The returned recovery point objects.
        public let recoveryPoints: [RecoveryPoint]?

        public init(nextToken: String? = nil, recoveryPoints: [RecoveryPoint]? = nil) {
            self.nextToken = nextToken
            self.recoveryPoints = recoveryPoints
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case recoveryPoints
        }
    }

    public struct ListSnapshotsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// The timestamp showing when the snapshot creation finished.
        public let endTime: Date?
        /// An optional parameter that specifies the maximum number of results to return. You can use nextToken to display the next page of results.
        public let maxResults: Int?
        /// The Amazon Resource Name (ARN) of the namespace from which to list all snapshots.
        public let namespaceArn: String?
        /// The namespace from which to list all snapshots.
        public let namespaceName: String?
        /// If nextToken is returned, there are more results available.  The value of nextToken is a unique pagination token for each page.  Make the call again using the returned token to retrieve the next page.
        public let nextToken: String?
        /// The owner Amazon Web Services account of the snapshot.
        public let ownerAccount: String?
        /// The time when the creation of the snapshot was initiated.
        public let startTime: Date?

        public init(endTime: Date? = nil, maxResults: Int? = nil, namespaceArn: String? = nil, namespaceName: String? = nil, nextToken: String? = nil, ownerAccount: String? = nil, startTime: Date? = nil) {
            self.endTime = endTime
            self.maxResults = maxResults
            self.namespaceArn = namespaceArn
            self.namespaceName = namespaceName
            self.nextToken = nextToken
            self.ownerAccount = ownerAccount
            self.startTime = startTime
        }

        private enum CodingKeys: String, CodingKey {
            case endTime
            case namespaceArn
            case namespaceName
            case ownerAccount
            case startTime
        }
    }

    public struct ListSnapshotsResponse: AWSDecodableShape {
        /// If nextToken is returned, there are more results available.  The value of nextToken is a unique pagination token for each page.  Make the call again using the returned token to retrieve the next page.
        public let nextToken: String?
        /// All of the returned snapshot objects.
        public let snapshots: [Snapshot]?

        public init(nextToken: String? = nil, snapshots: [Snapshot]? = nil) {
            self.nextToken = nextToken
            self.snapshots = snapshots
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case snapshots
        }
    }

    public struct ListTableRestoreStatusRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// An optional parameter that specifies the maximum number of results to  return. You can use nextToken to display the next page of results.
        public let maxResults: Int?
        /// The namespace from which to list all of the statuses of RestoreTableFromSnapshot operations .
        public let namespaceName: String?
        /// If your initial ListTableRestoreStatus operation returns a nextToken,  you can include the returned nextToken in following ListTableRestoreStatus operations. This will return results on the next page.
        public let nextToken: String?
        /// The workgroup from which to list all of the statuses of RestoreTableFromSnapshot operations.
        public let workgroupName: String?

        public init(maxResults: Int? = nil, namespaceName: String? = nil, nextToken: String? = nil, workgroupName: String? = nil) {
            self.maxResults = maxResults
            self.namespaceName = namespaceName
            self.nextToken = nextToken
            self.workgroupName = workgroupName
        }

        public func validate(name: String) throws {
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 8)
        }

        private enum CodingKeys: String, CodingKey {
            case namespaceName
            case workgroupName
        }
    }

    public struct ListTableRestoreStatusResponse: AWSDecodableShape {
        /// If your initial ListTableRestoreStatus operation returns a nextToken,  you can include the returned nextToken in following ListTableRestoreStatus operations. This will returns results on the next page.
        public let nextToken: String?
        /// The array of returned TableRestoreStatus objects.
        public let tableRestoreStatuses: [TableRestoreStatus]?

        public init(nextToken: String? = nil, tableRestoreStatuses: [TableRestoreStatus]? = nil) {
            self.nextToken = nextToken
            self.tableRestoreStatuses = tableRestoreStatuses
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case tableRestoreStatuses
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource to list tags for.
        public let resourceArn: String

        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1011)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn
        }
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// A map of the key-value pairs assigned to the resource.
        public let tags: [Tag]?

        public init(tags: [Tag]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags
        }
    }

    public struct ListUsageLimitsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// An optional parameter that specifies the maximum number of results to return. You can use nextToken to get the next page of results. The default is 100.
        public let maxResults: Int?
        /// If your initial ListUsageLimits operation returns a nextToken, you can include the returned nextToken in following ListUsageLimits operations, which returns results in the next page.
        public let nextToken: String?
        /// The Amazon Resource Name (ARN) associated with the resource whose usage limits you want to list.
        public let resourceArn: String?
        /// The Amazon Redshift Serverless feature whose limits you want to see.
        public let usageType: UsageLimitUsageType?

        public init(maxResults: Int? = nil, nextToken: String? = nil, resourceArn: String? = nil, usageType: UsageLimitUsageType? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.resourceArn = resourceArn
            self.usageType = usageType
        }

        public func validate(name: String) throws {
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 8)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn
            case usageType
        }
    }

    public struct ListUsageLimitsResponse: AWSDecodableShape {
        /// When nextToken is returned, there are more results available.  The value of nextToken is a unique pagination token for each page.  Make the call again using the returned token to retrieve the next page.
        public let nextToken: String?
        /// An array of returned usage limit objects.
        public let usageLimits: [UsageLimit]?

        public init(nextToken: String? = nil, usageLimits: [UsageLimit]? = nil) {
            self.nextToken = nextToken
            self.usageLimits = usageLimits
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case usageLimits
        }
    }

    public struct ListWorkgroupsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        /// An optional parameter that specifies the maximum number of results to return. You can use nextToken to display the next page of results.
        public let maxResults: Int?
        /// If your initial ListWorkgroups operation returns a nextToken, you can include the returned nextToken in following ListNamespaces operations, which returns results in the next page.
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListWorkgroupsResponse: AWSDecodableShape {
        ///  If nextToken is returned, there are more results available.  The value of nextToken is a unique pagination token for each page.  To retrieve the next page, make the call again using the returned token.
        public let nextToken: String?
        /// The returned array of workgroups.
        public let workgroups: [Workgroup]

        public init(nextToken: String? = nil, workgroups: [Workgroup]) {
            self.nextToken = nextToken
            self.workgroups = workgroups
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case workgroups
        }
    }

    public struct Namespace: AWSDecodableShape {
        /// The username of the administrator for the first database created in the namespace.
        public let adminUsername: String?
        /// The date of when the namespace was created.
        public let creationDate: Date?
        /// The name of the first database created in the namespace.
        public let dbName: String?
        /// The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.
        public let defaultIamRoleArn: String?
        /// A list of IAM roles to associate with the namespace.
        public let iamRoles: [String]?
        /// The ID of the Amazon Web Services Key Management Service key used to encrypt your data.
        public let kmsKeyId: String?
        /// The types of logs the namespace can export. Available export types are User log, Connection log, and User activity log.
        public let logExports: [LogExport]?
        /// The Amazon Resource Name (ARN) associated with a namespace.
        public let namespaceArn: String?
        /// The unique identifier of a namespace.
        public let namespaceId: String?
        /// The name of the namespace.  Must be between 3-64 alphanumeric characters in lowercase,  and it cannot be a reserved word. A list of reserved words can be found  in Reserved Words in the Amazon Redshift Database Developer Guide.
        public let namespaceName: String?
        /// The status of the namespace.
        public let status: NamespaceStatus?

        public init(adminUsername: String? = nil, creationDate: Date? = nil, dbName: String? = nil, defaultIamRoleArn: String? = nil, iamRoles: [String]? = nil, kmsKeyId: String? = nil, logExports: [LogExport]? = nil, namespaceArn: String? = nil, namespaceId: String? = nil, namespaceName: String? = nil, status: NamespaceStatus? = nil) {
            self.adminUsername = adminUsername
            self.creationDate = creationDate
            self.dbName = dbName
            self.defaultIamRoleArn = defaultIamRoleArn
            self.iamRoles = iamRoles
            self.kmsKeyId = kmsKeyId
            self.logExports = logExports
            self.namespaceArn = namespaceArn
            self.namespaceId = namespaceId
            self.namespaceName = namespaceName
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case adminUsername
            case creationDate
            case dbName
            case defaultIamRoleArn
            case iamRoles
            case kmsKeyId
            case logExports
            case namespaceArn
            case namespaceId
            case namespaceName
            case status
        }
    }

    public struct NetworkInterface: AWSDecodableShape {
        /// The availability Zone.
        public let availabilityZone: String?
        /// The unique identifier of the network interface.
        public let networkInterfaceId: String?
        /// The IPv4 address of the network interface within the subnet.
        public let privateIpAddress: String?
        /// The unique identifier of the subnet.
        public let subnetId: String?

        public init(availabilityZone: String? = nil, networkInterfaceId: String? = nil, privateIpAddress: String? = nil, subnetId: String? = nil) {
            self.availabilityZone = availabilityZone
            self.networkInterfaceId = networkInterfaceId
            self.privateIpAddress = privateIpAddress
            self.subnetId = subnetId
        }

        private enum CodingKeys: String, CodingKey {
            case availabilityZone
            case networkInterfaceId
            case privateIpAddress
            case subnetId
        }
    }

    public struct PutResourcePolicyRequest: AWSEncodableShape {
        /// The policy to create or update. For example, the following policy grants a user authorization to restore a snapshot.  "{\"Version\": \"2012-10-17\", \"Statement\" :  [{ \"Sid\": \"AllowUserRestoreFromSnapshot\", \"Principal\":{\"AWS\":  [\"739247239426\"]}, \"Action\": [\"redshift-serverless:RestoreFromSnapshot\"] , \"Effect\": \"Allow\" }]}"
        public let policy: String
        /// The Amazon Resource Name (ARN) of the account to create or update a resource policy for.
        public let resourceArn: String

        public init(policy: String, resourceArn: String) {
            self.policy = policy
            self.resourceArn = resourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case policy
            case resourceArn
        }
    }

    public struct PutResourcePolicyResponse: AWSDecodableShape {
        /// The policy that was created or updated.
        public let resourcePolicy: ResourcePolicy?

        public init(resourcePolicy: ResourcePolicy? = nil) {
            self.resourcePolicy = resourcePolicy
        }

        private enum CodingKeys: String, CodingKey {
            case resourcePolicy
        }
    }

    public struct RecoveryPoint: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the namespace the recovery point is associated with.
        public let namespaceArn: String?
        /// The name of the namespace the recovery point is associated with.
        public let namespaceName: String?
        /// The time the recovery point is created.
        public let recoveryPointCreateTime: Date?
        /// The unique identifier of the recovery point.
        public let recoveryPointId: String?
        /// The total size of the data in the recovery point in megabytes.
        public let totalSizeInMegaBytes: Double?
        /// The name of the workgroup the recovery point is associated with.
        public let workgroupName: String?

        public init(namespaceArn: String? = nil, namespaceName: String? = nil, recoveryPointCreateTime: Date? = nil, recoveryPointId: String? = nil, totalSizeInMegaBytes: Double? = nil, workgroupName: String? = nil) {
            self.namespaceArn = namespaceArn
            self.namespaceName = namespaceName
            self.recoveryPointCreateTime = recoveryPointCreateTime
            self.recoveryPointId = recoveryPointId
            self.totalSizeInMegaBytes = totalSizeInMegaBytes
            self.workgroupName = workgroupName
        }

        private enum CodingKeys: String, CodingKey {
            case namespaceArn
            case namespaceName
            case recoveryPointCreateTime
            case recoveryPointId
            case totalSizeInMegaBytes
            case workgroupName
        }
    }

    public struct ResourcePolicy: AWSDecodableShape {
        /// The resource policy.
        public let policy: String?
        /// The Amazon Resource Name (ARN) of the policy.
        public let resourceArn: String?

        public init(policy: String? = nil, resourceArn: String? = nil) {
            self.policy = policy
            self.resourceArn = resourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case policy
            case resourceArn
        }
    }

    public struct RestoreFromRecoveryPointRequest: AWSEncodableShape {
        /// The name of the namespace to restore data into.
        public let namespaceName: String
        /// The unique identifier of the recovery point to restore from.
        public let recoveryPointId: String
        /// The name of the workgroup used to restore data.
        public let workgroupName: String

        public init(namespaceName: String, recoveryPointId: String, workgroupName: String) {
            self.namespaceName = namespaceName
            self.recoveryPointId = recoveryPointId
            self.workgroupName = workgroupName
        }

        public func validate(name: String) throws {
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, max: 64)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, min: 3)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, pattern: "^[a-z0-9-]+$")
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, max: 64)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, min: 3)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, pattern: "^[a-z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case namespaceName
            case recoveryPointId
            case workgroupName
        }
    }

    public struct RestoreFromRecoveryPointResponse: AWSDecodableShape {
        /// The namespace that data was restored into.
        public let namespace: Namespace?
        /// The unique identifier of the recovery point used for the restore.
        public let recoveryPointId: String?

        public init(namespace: Namespace? = nil, recoveryPointId: String? = nil) {
            self.namespace = namespace
            self.recoveryPointId = recoveryPointId
        }

        private enum CodingKeys: String, CodingKey {
            case namespace
            case recoveryPointId
        }
    }

    public struct RestoreFromSnapshotRequest: AWSEncodableShape {
        /// The name of the namespace to restore the snapshot to.
        public let namespaceName: String
        /// The Amazon Web Services account that owns the snapshot.
        public let ownerAccount: String?
        /// The Amazon Resource Name (ARN) of the snapshot to restore from. Required if restoring from Amazon Redshift Serverless to a provisioned cluster. Must not be specified at the same time as snapshotName. The format of the ARN is arn:aws:redshift:&lt;region&gt;:&lt;account_id&gt;:snapshot:&lt;cluster_identifier&gt;/&lt;snapshot_identifier&gt;.
        public let snapshotArn: String?
        /// The name of the snapshot to restore from. Must not be specified at the same time as snapshotArn.
        public let snapshotName: String?
        /// The name of the workgroup used to restore the snapshot.
        public let workgroupName: String

        public init(namespaceName: String, ownerAccount: String? = nil, snapshotArn: String? = nil, snapshotName: String? = nil, workgroupName: String) {
            self.namespaceName = namespaceName
            self.ownerAccount = ownerAccount
            self.snapshotArn = snapshotArn
            self.snapshotName = snapshotName
            self.workgroupName = workgroupName
        }

        public func validate(name: String) throws {
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, max: 64)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, min: 3)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, pattern: "^[a-z0-9-]+$")
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, max: 64)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, min: 3)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, pattern: "^[a-z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case namespaceName
            case ownerAccount
            case snapshotArn
            case snapshotName
            case workgroupName
        }
    }

    public struct RestoreFromSnapshotResponse: AWSDecodableShape {
        public let namespace: Namespace?
        /// The owner Amazon Web Services; account of the snapshot that was restored.
        public let ownerAccount: String?
        /// The name of the snapshot used to restore the namespace.
        public let snapshotName: String?

        public init(namespace: Namespace? = nil, ownerAccount: String? = nil, snapshotName: String? = nil) {
            self.namespace = namespace
            self.ownerAccount = ownerAccount
            self.snapshotName = snapshotName
        }

        private enum CodingKeys: String, CodingKey {
            case namespace
            case ownerAccount
            case snapshotName
        }
    }

    public struct RestoreTableFromSnapshotRequest: AWSEncodableShape {
        /// Indicates whether name identifiers for database, schema, and table  are case sensitive. If true, the names are case sensitive. If  false, the names are not case sensitive. The default is false.
        public let activateCaseSensitiveIdentifier: Bool?
        /// The namespace of the snapshot to restore from.
        public let namespaceName: String
        /// The name of the table to create from the restore operation.
        public let newTableName: String
        /// The name of the snapshot to restore the table from.
        public let snapshotName: String
        /// The name of the source database that contains the table being restored.
        public let sourceDatabaseName: String
        /// The name of the source schema that contains the table being restored.
        public let sourceSchemaName: String?
        /// The name of the source table being restored.
        public let sourceTableName: String
        /// The name of the database to restore the table to.
        public let targetDatabaseName: String?
        /// The name of the schema to restore the table to.
        public let targetSchemaName: String?
        /// The workgroup to restore the table to.
        public let workgroupName: String

        public init(activateCaseSensitiveIdentifier: Bool? = nil, namespaceName: String, newTableName: String, snapshotName: String, sourceDatabaseName: String, sourceSchemaName: String? = nil, sourceTableName: String, targetDatabaseName: String? = nil, targetSchemaName: String? = nil, workgroupName: String) {
            self.activateCaseSensitiveIdentifier = activateCaseSensitiveIdentifier
            self.namespaceName = namespaceName
            self.newTableName = newTableName
            self.snapshotName = snapshotName
            self.sourceDatabaseName = sourceDatabaseName
            self.sourceSchemaName = sourceSchemaName
            self.sourceTableName = sourceTableName
            self.targetDatabaseName = targetDatabaseName
            self.targetSchemaName = targetSchemaName
            self.workgroupName = workgroupName
        }

        private enum CodingKeys: String, CodingKey {
            case activateCaseSensitiveIdentifier
            case namespaceName
            case newTableName
            case snapshotName
            case sourceDatabaseName
            case sourceSchemaName
            case sourceTableName
            case targetDatabaseName
            case targetSchemaName
            case workgroupName
        }
    }

    public struct RestoreTableFromSnapshotResponse: AWSDecodableShape {
        /// The TableRestoreStatus object that contains the status of the restore operation.
        public let tableRestoreStatus: TableRestoreStatus?

        public init(tableRestoreStatus: TableRestoreStatus? = nil) {
            self.tableRestoreStatus = tableRestoreStatus
        }

        private enum CodingKeys: String, CodingKey {
            case tableRestoreStatus
        }
    }

    public struct Snapshot: AWSDecodableShape {
        /// All of the Amazon Web Services accounts that have access to restore a snapshot to a provisioned cluster.
        public let accountsWithProvisionedRestoreAccess: [String]?
        /// All of the Amazon Web Services accounts that have access to  restore a snapshot to a namespace.
        public let accountsWithRestoreAccess: [String]?
        /// The size of the incremental backup in megabytes.
        public let actualIncrementalBackupSizeInMegaBytes: Double?
        /// The username of the database within a snapshot.
        public let adminUsername: String?
        /// The size in megabytes of the data that has been backed up to a snapshot.
        public let backupProgressInMegaBytes: Double?
        /// The rate at which data is backed up into a snapshot in megabytes per second.
        public let currentBackupRateInMegaBytesPerSecond: Double?
        /// The amount of time it took to back up data into a snapshot.
        public let elapsedTimeInSeconds: Int64?
        /// The estimated amount of seconds until the snapshot completes backup.
        public let estimatedSecondsToCompletion: Int64?
        /// The unique identifier of the KMS key used to encrypt the snapshot.
        public let kmsKeyId: String?
        /// The Amazon Resource Name (ARN) of the namespace the snapshot was created from.
        public let namespaceArn: String?
        /// The name of the namepsace.
        public let namespaceName: String?
        /// The owner Amazon Web Services; account of the snapshot.
        public let ownerAccount: String?
        /// The Amazon Resource Name (ARN) of the snapshot.
        public let snapshotArn: String?
        /// The timestamp of when the snapshot was created.
        public let snapshotCreateTime: Date?
        /// The name of the snapshot.
        public let snapshotName: String?
        /// The amount of days until the snapshot is deleted.
        public let snapshotRemainingDays: Int?
        /// The period of time, in days, of how long the snapshot is retained.
        public let snapshotRetentionPeriod: Int?
        /// The timestamp of when data within the snapshot started getting retained.
        public let snapshotRetentionStartTime: Date?
        /// The status of the snapshot.
        public let status: SnapshotStatus?
        /// The total size, in megabytes, of how big the snapshot is.
        public let totalBackupSizeInMegaBytes: Double?

        public init(accountsWithProvisionedRestoreAccess: [String]? = nil, accountsWithRestoreAccess: [String]? = nil, actualIncrementalBackupSizeInMegaBytes: Double? = nil, adminUsername: String? = nil, backupProgressInMegaBytes: Double? = nil, currentBackupRateInMegaBytesPerSecond: Double? = nil, elapsedTimeInSeconds: Int64? = nil, estimatedSecondsToCompletion: Int64? = nil, kmsKeyId: String? = nil, namespaceArn: String? = nil, namespaceName: String? = nil, ownerAccount: String? = nil, snapshotArn: String? = nil, snapshotCreateTime: Date? = nil, snapshotName: String? = nil, snapshotRemainingDays: Int? = nil, snapshotRetentionPeriod: Int? = nil, snapshotRetentionStartTime: Date? = nil, status: SnapshotStatus? = nil, totalBackupSizeInMegaBytes: Double? = nil) {
            self.accountsWithProvisionedRestoreAccess = accountsWithProvisionedRestoreAccess
            self.accountsWithRestoreAccess = accountsWithRestoreAccess
            self.actualIncrementalBackupSizeInMegaBytes = actualIncrementalBackupSizeInMegaBytes
            self.adminUsername = adminUsername
            self.backupProgressInMegaBytes = backupProgressInMegaBytes
            self.currentBackupRateInMegaBytesPerSecond = currentBackupRateInMegaBytesPerSecond
            self.elapsedTimeInSeconds = elapsedTimeInSeconds
            self.estimatedSecondsToCompletion = estimatedSecondsToCompletion
            self.kmsKeyId = kmsKeyId
            self.namespaceArn = namespaceArn
            self.namespaceName = namespaceName
            self.ownerAccount = ownerAccount
            self.snapshotArn = snapshotArn
            self.snapshotCreateTime = snapshotCreateTime
            self.snapshotName = snapshotName
            self.snapshotRemainingDays = snapshotRemainingDays
            self.snapshotRetentionPeriod = snapshotRetentionPeriod
            self.snapshotRetentionStartTime = snapshotRetentionStartTime
            self.status = status
            self.totalBackupSizeInMegaBytes = totalBackupSizeInMegaBytes
        }

        private enum CodingKeys: String, CodingKey {
            case accountsWithProvisionedRestoreAccess
            case accountsWithRestoreAccess
            case actualIncrementalBackupSizeInMegaBytes
            case adminUsername
            case backupProgressInMegaBytes
            case currentBackupRateInMegaBytesPerSecond
            case elapsedTimeInSeconds
            case estimatedSecondsToCompletion
            case kmsKeyId
            case namespaceArn
            case namespaceName
            case ownerAccount
            case snapshotArn
            case snapshotCreateTime
            case snapshotName
            case snapshotRemainingDays
            case snapshotRetentionPeriod
            case snapshotRetentionStartTime
            case status
            case totalBackupSizeInMegaBytes
        }
    }

    public struct TableRestoreStatus: AWSDecodableShape {
        /// A description of the status of the table restore request.  Status values include SUCCEEDED, FAILED, CANCELED, PENDING, IN_PROGRESS.
        public let message: String?
        /// The namespace of the table being restored from.
        public let namespaceName: String?
        /// The name of the table to create from the restore operation.
        public let newTableName: String?
        /// The amount of data restored to the new table so far, in megabytes (MB).
        public let progressInMegaBytes: Int64?
        /// The time that the table restore request was made,  in Universal Coordinated Time (UTC).
        public let requestTime: Date?
        /// The name of the snapshot being restored from.
        public let snapshotName: String?
        /// The name of the source database being restored from.
        public let sourceDatabaseName: String?
        /// The name of the source schema being restored from.
        public let sourceSchemaName: String?
        /// The name of the source table being restored from.
        public let sourceTableName: String?
        /// A value that describes the current state of the table restore request.  Possible values include SUCCEEDED, FAILED, CANCELED, PENDING, IN_PROGRESS.
        public let status: String?
        /// The ID of the RestoreTableFromSnapshot request.
        public let tableRestoreRequestId: String?
        /// The name of the database to restore to.
        public let targetDatabaseName: String?
        /// The name of the schema to restore to.
        public let targetSchemaName: String?
        /// The total amount of data to restore to the new table, in megabytes (MB).
        public let totalDataInMegaBytes: Int64?
        /// The name of the workgroup being restored from.
        public let workgroupName: String?

        public init(message: String? = nil, namespaceName: String? = nil, newTableName: String? = nil, progressInMegaBytes: Int64? = nil, requestTime: Date? = nil, snapshotName: String? = nil, sourceDatabaseName: String? = nil, sourceSchemaName: String? = nil, sourceTableName: String? = nil, status: String? = nil, tableRestoreRequestId: String? = nil, targetDatabaseName: String? = nil, targetSchemaName: String? = nil, totalDataInMegaBytes: Int64? = nil, workgroupName: String? = nil) {
            self.message = message
            self.namespaceName = namespaceName
            self.newTableName = newTableName
            self.progressInMegaBytes = progressInMegaBytes
            self.requestTime = requestTime
            self.snapshotName = snapshotName
            self.sourceDatabaseName = sourceDatabaseName
            self.sourceSchemaName = sourceSchemaName
            self.sourceTableName = sourceTableName
            self.status = status
            self.tableRestoreRequestId = tableRestoreRequestId
            self.targetDatabaseName = targetDatabaseName
            self.targetSchemaName = targetSchemaName
            self.totalDataInMegaBytes = totalDataInMegaBytes
            self.workgroupName = workgroupName
        }

        private enum CodingKeys: String, CodingKey {
            case message
            case namespaceName
            case newTableName
            case progressInMegaBytes
            case requestTime
            case snapshotName
            case sourceDatabaseName
            case sourceSchemaName
            case sourceTableName
            case status
            case tableRestoreRequestId
            case targetDatabaseName
            case targetSchemaName
            case totalDataInMegaBytes
            case workgroupName
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// The key to use in the tag.
        public let key: String
        /// The value of the tag.
        public let value: String

        public init(key: String, value: String) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.value, name: "value", parent: name, max: 256)
        }

        private enum CodingKeys: String, CodingKey {
            case key
            case value
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource to tag.
        public let resourceArn: String
        /// The map of the key-value pairs used to tag the resource.
        public let tags: [Tag]

        public init(resourceArn: String, tags: [Tag]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1011)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn
            case tags
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource to remove tags from.
        public let resourceArn: String
        /// The tag or set of tags to remove from the resource.
        public let tagKeys: [String]

        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1011)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn
            case tagKeys
        }
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateEndpointAccessRequest: AWSEncodableShape {
        /// The name of the VPC endpoint to update.
        public let endpointName: String
        /// The list of VPC security groups associated with the endpoint after the endpoint is modified.
        public let vpcSecurityGroupIds: [String]?

        public init(endpointName: String, vpcSecurityGroupIds: [String]? = nil) {
            self.endpointName = endpointName
            self.vpcSecurityGroupIds = vpcSecurityGroupIds
        }

        private enum CodingKeys: String, CodingKey {
            case endpointName
            case vpcSecurityGroupIds
        }
    }

    public struct UpdateEndpointAccessResponse: AWSDecodableShape {
        /// The updated VPC endpoint.
        public let endpoint: EndpointAccess?

        public init(endpoint: EndpointAccess? = nil) {
            self.endpoint = endpoint
        }

        private enum CodingKeys: String, CodingKey {
            case endpoint
        }
    }

    public struct UpdateNamespaceRequest: AWSEncodableShape {
        /// The username of the administrator for the first database created in the namespace.
        public let adminUsername: String?
        /// The password of the administrator for the first database created in the namespace.
        public let adminUserPassword: String?
        /// The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.
        public let defaultIamRoleArn: String?
        /// A list of IAM roles to associate with the namespace.
        public let iamRoles: [String]?
        /// The ID of the Amazon Web Services Key Management Service key used to encrypt your data.
        public let kmsKeyId: String?
        /// The types of logs the namespace can export. The export types are userlog, connectionlog, and useractivitylog.
        public let logExports: [LogExport]?
        /// The name of the namespace.
        public let namespaceName: String

        public init(adminUsername: String? = nil, adminUserPassword: String? = nil, defaultIamRoleArn: String? = nil, iamRoles: [String]? = nil, kmsKeyId: String? = nil, logExports: [LogExport]? = nil, namespaceName: String) {
            self.adminUsername = adminUsername
            self.adminUserPassword = adminUserPassword
            self.defaultIamRoleArn = defaultIamRoleArn
            self.iamRoles = iamRoles
            self.kmsKeyId = kmsKeyId
            self.logExports = logExports
            self.namespaceName = namespaceName
        }

        public func validate(name: String) throws {
            try self.validate(self.logExports, name: "logExports", parent: name, max: 16)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, max: 64)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, min: 3)
            try self.validate(self.namespaceName, name: "namespaceName", parent: name, pattern: "^[a-z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case adminUsername
            case adminUserPassword
            case defaultIamRoleArn
            case iamRoles
            case kmsKeyId
            case logExports
            case namespaceName
        }
    }

    public struct UpdateNamespaceResponse: AWSDecodableShape {
        /// A list of tag instances.
        public let namespace: Namespace

        public init(namespace: Namespace) {
            self.namespace = namespace
        }

        private enum CodingKeys: String, CodingKey {
            case namespace
        }
    }

    public struct UpdateSnapshotRequest: AWSEncodableShape {
        /// The new retention period of the snapshot.
        public let retentionPeriod: Int?
        /// The name of the snapshot.
        public let snapshotName: String

        public init(retentionPeriod: Int? = nil, snapshotName: String) {
            self.retentionPeriod = retentionPeriod
            self.snapshotName = snapshotName
        }

        private enum CodingKeys: String, CodingKey {
            case retentionPeriod
            case snapshotName
        }
    }

    public struct UpdateSnapshotResponse: AWSDecodableShape {
        /// The updated snapshot object.
        public let snapshot: Snapshot?

        public init(snapshot: Snapshot? = nil) {
            self.snapshot = snapshot
        }

        private enum CodingKeys: String, CodingKey {
            case snapshot
        }
    }

    public struct UpdateUsageLimitRequest: AWSEncodableShape {
        /// The new limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour.  If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing.  The value must be a positive number.
        public let amount: Int64?
        /// The new action that Amazon Redshift Serverless takes when the limit is reached.
        public let breachAction: UsageLimitBreachAction?
        /// The identifier of the usage limit to update.
        public let usageLimitId: String

        public init(amount: Int64? = nil, breachAction: UsageLimitBreachAction? = nil, usageLimitId: String) {
            self.amount = amount
            self.breachAction = breachAction
            self.usageLimitId = usageLimitId
        }

        private enum CodingKeys: String, CodingKey {
            case amount
            case breachAction
            case usageLimitId
        }
    }

    public struct UpdateUsageLimitResponse: AWSDecodableShape {
        /// The updated usage limit object.
        public let usageLimit: UsageLimit?

        public init(usageLimit: UsageLimit? = nil) {
            self.usageLimit = usageLimit
        }

        private enum CodingKeys: String, CodingKey {
            case usageLimit
        }
    }

    public struct UpdateWorkgroupRequest: AWSEncodableShape {
        /// The new base data warehouse capacity in Redshift Processing Units (RPUs).
        public let baseCapacity: Int?
        /// An array of parameters to set for advanced control over a database. The options are datestyle, enable_user_activity_logging, query_group, search_path, and max_query_execution_time.
        public let configParameters: [ConfigParameter]?
        /// The value that specifies whether to turn on enhanced virtual  private cloud (VPC) routing, which forces Amazon Redshift Serverless to route traffic through your VPC.
        public let enhancedVpcRouting: Bool?
        /// The custom port to use when connecting to a workgroup. Valid port ranges are 5431-5455 and 8191-8215. The default is 5439.
        public let port: Int?
        /// A value that specifies whether the workgroup can be accessible from a public network.
        public let publiclyAccessible: Bool?
        /// An array of security group IDs to associate with the workgroup.
        public let securityGroupIds: [String]?
        /// An array of VPC subnet IDs to associate with the workgroup.
        public let subnetIds: [String]?
        /// The name of the workgroup to update.
        public let workgroupName: String

        public init(baseCapacity: Int? = nil, configParameters: [ConfigParameter]? = nil, enhancedVpcRouting: Bool? = nil, port: Int? = nil, publiclyAccessible: Bool? = nil, securityGroupIds: [String]? = nil, subnetIds: [String]? = nil, workgroupName: String) {
            self.baseCapacity = baseCapacity
            self.configParameters = configParameters
            self.enhancedVpcRouting = enhancedVpcRouting
            self.port = port
            self.publiclyAccessible = publiclyAccessible
            self.securityGroupIds = securityGroupIds
            self.subnetIds = subnetIds
            self.workgroupName = workgroupName
        }

        public func validate(name: String) throws {
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, max: 64)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, min: 3)
            try self.validate(self.workgroupName, name: "workgroupName", parent: name, pattern: "^[a-z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case baseCapacity
            case configParameters
            case enhancedVpcRouting
            case port
            case publiclyAccessible
            case securityGroupIds
            case subnetIds
            case workgroupName
        }
    }

    public struct UpdateWorkgroupResponse: AWSDecodableShape {
        /// The updated workgroup object.
        public let workgroup: Workgroup

        public init(workgroup: Workgroup) {
            self.workgroup = workgroup
        }

        private enum CodingKeys: String, CodingKey {
            case workgroup
        }
    }

    public struct UsageLimit: AWSDecodableShape {
        /// The limit amount. If time-based, this amount is in RPUs consumed per hour. If data-based, this amount is in terabytes (TB). The value must be a positive number.
        public let amount: Int64?
        /// The action that Amazon Redshift Serverless takes when the limit is reached.
        public let breachAction: UsageLimitBreachAction?
        /// The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.
        public let period: UsageLimitPeriod?
        /// The Amazon Resource Name (ARN) that identifies the Amazon Redshift Serverless resource.
        public let resourceArn: String?
        /// The Amazon Resource Name (ARN) of the resource associated with the usage limit.
        public let usageLimitArn: String?
        /// The identifier of the usage limit.
        public let usageLimitId: String?
        /// The Amazon Redshift Serverless feature to limit.
        public let usageType: UsageLimitUsageType?

        public init(amount: Int64? = nil, breachAction: UsageLimitBreachAction? = nil, period: UsageLimitPeriod? = nil, resourceArn: String? = nil, usageLimitArn: String? = nil, usageLimitId: String? = nil, usageType: UsageLimitUsageType? = nil) {
            self.amount = amount
            self.breachAction = breachAction
            self.period = period
            self.resourceArn = resourceArn
            self.usageLimitArn = usageLimitArn
            self.usageLimitId = usageLimitId
            self.usageType = usageType
        }

        private enum CodingKeys: String, CodingKey {
            case amount
            case breachAction
            case period
            case resourceArn
            case usageLimitArn
            case usageLimitId
            case usageType
        }
    }

    public struct VpcEndpoint: AWSDecodableShape {
        /// One or more network interfaces of the endpoint. Also known as an interface endpoint.
        public let networkInterfaces: [NetworkInterface]?
        /// The connection endpoint ID for connecting to Amazon Redshift Serverless.
        public let vpcEndpointId: String?
        /// The VPC identifier that the endpoint is associated with.
        public let vpcId: String?

        public init(networkInterfaces: [NetworkInterface]? = nil, vpcEndpointId: String? = nil, vpcId: String? = nil) {
            self.networkInterfaces = networkInterfaces
            self.vpcEndpointId = vpcEndpointId
            self.vpcId = vpcId
        }

        private enum CodingKeys: String, CodingKey {
            case networkInterfaces
            case vpcEndpointId
            case vpcId
        }
    }

    public struct VpcSecurityGroupMembership: AWSDecodableShape {
        /// The status of the VPC security group.
        public let status: String?
        /// The unique identifier of the VPC security group.
        public let vpcSecurityGroupId: String?

        public init(status: String? = nil, vpcSecurityGroupId: String? = nil) {
            self.status = status
            self.vpcSecurityGroupId = vpcSecurityGroupId
        }

        private enum CodingKeys: String, CodingKey {
            case status
            case vpcSecurityGroupId
        }
    }

    public struct Workgroup: AWSDecodableShape {
        /// The base data warehouse capacity of the workgroup in Redshift Processing Units (RPUs).
        public let baseCapacity: Int?
        /// An array of parameters to set for finer control over a database. The options are datestyle, enable_user_activity_logging, query_group, search_path, and max_query_execution_time.
        public let configParameters: [ConfigParameter]?
        /// The creation date of the workgroup.
        public let creationDate: Date?
        /// The endpoint that is created from the workgroup.
        public let endpoint: Endpoint?
        /// The value that specifies whether to enable enhanced virtual  private cloud (VPC) routing, which forces Amazon Redshift Serverless to route traffic through your VPC.
        public let enhancedVpcRouting: Bool?
        /// The namespace the workgroup is associated with.
        public let namespaceName: String?
        /// The custom port to use when connecting to a workgroup. Valid port ranges are 5431-5455 and 8191-8215. The default is 5439.
        public let port: Int?
        /// A value that specifies whether the workgroup  can be accessible from a public network
        public let publiclyAccessible: Bool?
        /// An array of security group IDs to associate with the workgroup.
        public let securityGroupIds: [String]?
        /// The status of the workgroup.
        public let status: WorkgroupStatus?
        /// An array of subnet IDs the workgroup is associated with.
        public let subnetIds: [String]?
        /// The Amazon Resource Name (ARN) that links to the workgroup.
        public let workgroupArn: String?
        /// The unique identifier of the workgroup.
        public let workgroupId: String?
        /// The name of the workgroup.
        public let workgroupName: String?

        public init(baseCapacity: Int? = nil, configParameters: [ConfigParameter]? = nil, creationDate: Date? = nil, endpoint: Endpoint? = nil, enhancedVpcRouting: Bool? = nil, namespaceName: String? = nil, port: Int? = nil, publiclyAccessible: Bool? = nil, securityGroupIds: [String]? = nil, status: WorkgroupStatus? = nil, subnetIds: [String]? = nil, workgroupArn: String? = nil, workgroupId: String? = nil, workgroupName: String? = nil) {
            self.baseCapacity = baseCapacity
            self.configParameters = configParameters
            self.creationDate = creationDate
            self.endpoint = endpoint
            self.enhancedVpcRouting = enhancedVpcRouting
            self.namespaceName = namespaceName
            self.port = port
            self.publiclyAccessible = publiclyAccessible
            self.securityGroupIds = securityGroupIds
            self.status = status
            self.subnetIds = subnetIds
            self.workgroupArn = workgroupArn
            self.workgroupId = workgroupId
            self.workgroupName = workgroupName
        }

        private enum CodingKeys: String, CodingKey {
            case baseCapacity
            case configParameters
            case creationDate
            case endpoint
            case enhancedVpcRouting
            case namespaceName
            case port
            case publiclyAccessible
            case securityGroupIds
            case status
            case subnetIds
            case workgroupArn
            case workgroupId
            case workgroupName
        }
    }
}

// MARK: - Errors

/// Error enum for RedshiftServerless
public struct RedshiftServerlessErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case conflictException = "ConflictException"
        case insufficientCapacityException = "InsufficientCapacityException"
        case internalServerException = "InternalServerException"
        case invalidPaginationException = "InvalidPaginationException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case serviceQuotaExceededException = "ServiceQuotaExceededException"
        case throttlingException = "ThrottlingException"
        case tooManyTagsException = "TooManyTagsException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize RedshiftServerless
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// You do not have sufficient access to perform this action.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// The submitted action has conflicts.
    public static var conflictException: Self { .init(.conflictException) }
    /// There is an insufficient capacity to perform the action.
    public static var insufficientCapacityException: Self { .init(.insufficientCapacityException) }
    /// The request processing has failed because of an unknown error, exception or failure.
    public static var internalServerException: Self { .init(.internalServerException) }
    /// The provided pagination token is invalid.
    public static var invalidPaginationException: Self { .init(.invalidPaginationException) }
    /// The resource could not be found.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// The service limit was exceeded.
    public static var serviceQuotaExceededException: Self { .init(.serviceQuotaExceededException) }
    /// The request was denied due to request throttling.
    public static var throttlingException: Self { .init(.throttlingException) }
    /// The request exceeded the number of tags allowed for a resource.
    public static var tooManyTagsException: Self { .init(.tooManyTagsException) }
    /// The input failed to satisfy the constraints specified by an AWS service.
    public static var validationException: Self { .init(.validationException) }
}

extension RedshiftServerlessErrorType: Equatable {
    public static func == (lhs: RedshiftServerlessErrorType, rhs: RedshiftServerlessErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension RedshiftServerlessErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
